package com.yanqu.road.server.cmd.union;

import com.yanqu.road.pb.union.UnionProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.union.UnionMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.server.command.Cmd;

//@Cmd(code = Protocol.S_UNION_QUIT, desc = "退出联盟")
@Deprecated
public class QuitUnionCmd extends AbstractCommand {

	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
		ret = UnionMgr.quitUnion(player);
	}

	@Override
	public void sendData(GamePlayer player) {
		UnionProto.UnionQuitRespMsg.Builder respMsg = UnionProto.UnionQuitRespMsg.newBuilder();
		respMsg.setRet(ret);
		player.sendPacket(Protocol.U_UNION_QUIT, respMsg);
	}

}
